// 55. 跳跃游戏
/**
 * @param {number[]} nums
 * @return {boolean}
 */
var canJump = function (nums) {
    let n = nums.length
    let rightMost = 0
    for (let i = 0; i < n; i++) {
        if (i > rightMost) return false
        rightMost = Math.max(rightMost, i + nums[i])
    }
    return true
};
canJump([3, 2, 1, 0, 4])